Skip to content

Conversation

@clemens-k
Copy link
Contributor

  • installs pinned version of codeql and preloads coding guideline packs for CERT and MISRA

other changes:

  • openjdk_21 21.0.9 is no longer available and needs to be updated to 21.0.10

@clemens-k
Copy link
Contributor Author

clemens-k commented Feb 3, 2026

resolves #69

Copy link
Contributor

@lurtz lurtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good so far

Signed-off-by: Clemens Kutz <53788793+clemens-k@users.noreply.github.com>
VARIANT=linux64
SHA256SUM="${codeql_amd64_sha256}"
elif [ "${ARCHITECTURE}" = "arm64" ]; then
VARIANT=osx
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

variant string is incorrect. But we should also investigate, if the osx variant runs on ubuntu arm64 at all...

Suggested change
VARIANT=osx
VARIANT=osx64

Copy link
Contributor Author

@clemens-k clemens-k Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codeql does not support ubuntu on arm64, just native macs. Although codeql engine is written in JAVA, the language specific extractors are native applications. Therefore codeql cannot be used on ubuntu arm64:

./cpp/tools/osx64/cpp-telemetry: Mach-O universal binary with 2 architectures: [x86_64:\012- Mach-O 64-bi...
./cpp/tools/osx64/extractor: Mach-O universal binary with 2 architectures: [x86_64:\012- Mach-O 64-bit x8...
./cpp/tools/osx64/trap-cache-reader: Mach-O universal binary with 2 architectures: [x86_64:\012- Mach-O 6...
./cpp/tools/osx64/hash: Mach-O universal binary with 2 architectures: [x86_64:\012- Mach-O 64-bit x...

I will remove codeql for arm64 architectures and install it only for amd64.

Copy link
Contributor Author

@clemens-k clemens-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ready to be merged

Signed-off-by: Clemens Kutz <53788793+clemens-k@users.noreply.github.com>
@clemens-k clemens-k requested a review from lurtz February 5, 2026 13:58
@lurtz
Copy link
Contributor

lurtz commented Feb 5, 2026

pay also attention to #76 (comment)

clemens-k and others added 2 commits February 5, 2026 15:54
okay

Co-authored-by: lurtz <727209+lurtz@users.noreply.github.com>
Signed-off-by: Clemens Kutz <53788793+clemens-k@users.noreply.github.com>
move codeql test to s-core-local tests

Signed-off-by: Clemens Kutz <53788793+clemens-k@users.noreply.github.com>
fixed incorrect path

Signed-off-by: Clemens Kutz <53788793+clemens-k@users.noreply.github.com>
Copy link
Contributor Author

@clemens-k clemens-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests were successful:

  • building the new devcontainer for amd64
  • test scripts showed no error
  • codeql is in PATH
  • codeql packs resolve showed codeql found the general, MISRA and CERT related rules
  • first experiment was successful: checking nlohmann/json against MISRA C++ rules

lurtz
lurtz previously approved these changes Feb 5, 2026
@AlexanderLanin
Copy link
Member

@clemens-k I'm afraid in the meantime shellcheck was added to this repo. Could you fix the resulting warnings in your PR?

AlexanderLanin
AlexanderLanin previously approved these changes Feb 9, 2026
@AlexanderLanin
Copy link
Member

@lurtz @opajonk according to @clemens-k this adds 1.7 GB to the image. Is that acceptable?

@AlexanderLanin AlexanderLanin dismissed stale reviews from lurtz and themself February 9, 2026 09:43

size impact to be consideered

@clemens-k
Copy link
Contributor Author

I can probably slim down the installation a bit (removing java, go, csharp, ruby and javascript extractors, example code and rules). This will reduce the size impact to 926 MB.
Hint: I am just looking at the installation path, I would need to test first if codeql is okay with just deleting these folders.

If we want to reduce more, we would need to drop Rust support (~100 MB) or CERT coding standards (~100 MB)...

@lurtz
Copy link
Contributor

lurtz commented Feb 9, 2026

@lurtz @opajonk according to @clemens-k this adds 1.7 GB to the image. Is that acceptable?

It is a lot.

This also opens the door of what has to be in the image and what not. E.g. a Rust and LLVM / clang toolchain is included as well, despite that presumably bazel downloads the toolchains. We did this because we either struggled to get code completion running otherwise, bazel was still using files from the host and we just have the opinion that we prefer toolchains provided by the devcontainer instead of bazel.

When we want to introduce the devcontainer in more CI builds, it is better to keep a small size and depending on the amount of tooling for CI or developers needed we could split it into two images: a small one used in CI with only essential tools needed for CI included and a bigger one, which builds on top of the small one with developer tools added. However this only makes sense if codeql is either only used by developers or in very few jobs.

@lurtz
Copy link
Contributor

lurtz commented Feb 9, 2026

This is the disk space usage added, by each layer of the container image:

image

Total image size is 4.3 GB. IMHO we should have a smaller image for CI.

FYI the image was inspected with https://github.com/wagoodman/dive

Copy link

@FScholPer FScholPer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the Readme?!

@FScholPer
Copy link

This is the disk space usage added, by each layer of the container image:

image Total image size is 4.3 GB. IMHO we should have a smaller image for CI.

FYI the image was inspected with https://github.com/wagoodman/dive

Do we still want to use llvm

@clemens-k
Copy link
Contributor Author

@lurtz I didn't know dive, that's an awesome tool. Thank you for the hint.

The intention of adding codeql was to enable SCA checks (MISRA C++ and CERT C++) in our code. The pipeline should run a SCA checks to make sure developers don't introduce new SCA warnings with a PR (or to at least make it visible).

For this pipeline usecase github already offers a github action. I found several PRs related to that, but they were not successful yet and the github action does not solve the issue of all developers to see those SCA warnings as early as possible (ideally while typing code while using the score devcontainer):

So the primary purpose of installing codeql and preloading the coding rules is that developers can easily run SCA checks.

As long as the github action doesn't produce usable results, we could also use this "local installation" as fallback for the pipeline. Which means we would also need to include codeql in the "slim" CI image.

@clemens-k
Copy link
Contributor Author

Can you update the Readme?!

What exactly is missing or outdated?

@clemens-k
Copy link
Contributor Author

@FScholPer @lurtz The action for amd64 was now successful, so the PR could be merged.

There are 2 open topics:

  • should llvm still be included in the image? -> maybe out of scope for this PR, discuss in weekly meeting?
  • updates to README.md requested, but unclear what's missing or wrong

@FScholPer
Copy link

Codeql documentation (howto) is missing

@lurtz
Copy link
Contributor

lurtz commented Feb 11, 2026

@FScholPer @lurtz The action for amd64 was now successful, so the PR could be merged.

There are 2 open topics:

* should llvm still be included in the image? -> maybe out of scope for this PR, discuss in weekly meeting?

* updates to README.md requested, but unclear what's missing or wrong

I will look into the size issues on main

@FScholPer FScholPer merged commit 23ff984 into eclipse-score:main Feb 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants